package com.sg.hms.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sg.hms.Service.FoodMenuService;
import com.sg.hms.ServiceImpl.FoodMenuServiceImpl;
/**
 * 
 * @author 张杨
 *
 */
public class DeleteFoodMenuController extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		super.doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		FoodMenuService fmservice=new FoodMenuServiceImpl();
		PrintWriter pw=resp.getWriter();
		String fmid[]=req.getParameterValues("fmid[]");
		int a=0;
		for (String f: fmid) {
		 a=fmservice.deleteFoodMenus(Integer.parseInt(f));
		}
		if (a==1) {
			pw.write('1');
		}
	}
}
